import myRequest from "./config/request";

const URL = "/menu";

export function getMenuListApi() {
  return myRequest.get({
    url: URL + "/getMenuList",
  });
}

export function getMenuTreeApi() {
  return myRequest.get({
    url: URL + "/getMenuTree",
  });
}

export function createMenuApi(data) {
  return myRequest.post({
    url: URL + "/createMenu",
    data,
  });
}

export function updateMenuApi(data) {
  return myRequest.post({
    url: URL + "/updateMenu",
    data,
  });
}

export function deleteMenuApi(id) {
  return myRequest.post({
    url: URL + "/deleteMenu",
    data: {
      id,
    },
  });
}
